package cn.bqjr.eily.core.utils;

import cn.bqjr.eily.core.entity.SysProperties;
import cn.bqjr.eily.utils.SpringContextUtils;

/**
 * System Configuration Utils
 *
 * @author hillfly
 */
public class SysConfigUtils {

    public static final String REQUEST_DEBUG = "debugMode";

    private static SysProperties sysProperties = null;

    public static SysProperties getProperties() {
        if (sysProperties == null) {
            sysProperties = SpringContextUtils.getBean(SysProperties.class);
        }
        return sysProperties;
    }

    public static boolean isDebugMode() {
        return getProperties().getDebug();
    }

    public static String getCacheKey(String key) {
        String prefix = getProperties().getSysName();
        return prefix + ":" + key;
    }
}
